//
//  DLRiskEvaluationVC.m
//  delongzhitou
//
//  Created by Mr.Wang on 2018/12/6.
//  Copyright © 2018 delongzhitou. All rights reserved.
//

#import "DLRiskEvaluationVC.h"
#import "DLRiskEvaluationDetailVC.h"

@implementation DLRiskEvaluationVC

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self setUpNav];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self layoutSubControls];
    
    
}

- (void) layoutSubControls {
    
    CGFloat imgVWidth = 55;
    CGFloat imgVHeight = imgVWidth;;
    UIImageView *imgV = [UIImageView new];
    imgV.frame = CGRectMake((kScreenWidth - imgVWidth) / 2, 35, imgVWidth, imgVHeight);
    imgV.image = [UIImage imageNamed:@"risk_notice"];
    [self.view addSubview:imgV];
    
    UILabel *titleLabel = [UILabel new];
    titleLabel.frame = CGRectMake(0, imgV.bottom + 20, kScreenWidth, 20);
    titleLabel.text = @"您尚未进行风险评估";
    titleLabel.textColor = kDLNormalBlackColor;
    titleLabel.font = kSystemFont(28);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titleLabel];
    
    UILabel *contentLabel = [UILabel new];
    contentLabel.frame = CGRectMake(titleLabel.left + 30, titleLabel.bottom + 30, kScreenWidth - 60, 50);
    contentLabel.text = @"根据监管要求，您在购买金融产品前，需要完成个人投资风险承受能力的评估。";
    contentLabel.textColor = kDLNormalGrayColor;
    contentLabel.numberOfLines = 0;
    contentLabel.font = kSystemFont(14);
    contentLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:contentLabel];
    
    UIButton *evaluationButton = [UIButton buttonWithType:UIButtonTypeCustom];
    evaluationButton.frame = CGRectMake(25, kScreenSafeAreaHeight - kHeightNavigation - 180, kScreenWidth - 50, 35);
    [evaluationButton setTitle:@"开始测评" forState:UIControlStateNormal];
    [evaluationButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    evaluationButton.titleLabel.font = kSystemFont(15);
    evaluationButton.backgroundColor = kDLBtnNormalBgColor;
    evaluationButton.layer.cornerRadius = 3;
    evaluationButton.clipsToBounds = YES;
    [self.view addSubview:evaluationButton];
    [evaluationButton addTarget:self action:@selector(evaluationButtonClick) forControlEvents:UIControlEventTouchUpInside];
}
- (void) evaluationButtonClick {
    DLRiskEvaluationDetailVC *redvc = [DLRiskEvaluationDetailVC new];
    [self.navigationController pushViewController:redvc animated:YES];
}


- (void) setUpNav {
    self.titleView.title = @"风险测评";
    
    UIButton *noticeButton = [UIButton buttonWithType:0];
    noticeButton.frame = CGRectMake(0, 0, 40, 30);
    [noticeButton setTitle:@"须知" forState:UIControlStateNormal];
    noticeButton.titleLabel.font = kSystemFont(14);
    [noticeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:noticeButton];
    [noticeButton addTarget:self action:@selector(noticeButtonClick) forControlEvents:UIControlEventTouchUpInside];
}
- (void) noticeButtonClick {
    NSLog(@"风险测评须知");
}



@end
